var e = getApp();

Page({
    data: {
        show: !0,
        value: "",
        line_code_switch: !1,
        parent_info: {
            member_id: 0
        }
    },
    onLoad: function(e) {
        wx.setNavigationBarTitle({
            title: "任务包"
        });
    },
    bindConfirm: function(e) {
        console.log(e, "确认"), this.confirmTap();
    },
    bindcancel: function(e) {
        wx.redirectTo({
            url: "/packageG/member_v2/member_v2"
        });
    },
    onChange: function(e) {
        this.setData({
            value: e.detail
        });
    },
    confirmTap: function() {
        e._getNetWork({
            url: e.getNetAddresss("plugin.task-package.frontend.index.complete-invite-code"),
            data: {
                invite_code: this.data.value
            },
            success: function(e) {
                var t = e.data;
                1 == t.result ? wx.redirectTo({
                    url: "/packageI/taskPackage/taskPackageIndex/taskPackageIndex"
                }) : wx.showModal({
                    title: "",
                    content: t.msg,
                    showCancel: !1,
                    complete: function(e) {
                        e.confirm ? "你已填写过邀请码" == t.msg && wx.redirectTo({
                            url: "/packageI/taskPackage/taskPackageIndex/taskPackageIndex"
                        }) : e.cancel && wx.redirectTo({
                            url: "/packageG/member_v2/member_v2"
                        });
                    }
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    getData: function() {
        var t = this;
        e._getNetWork({
            url: e.getNetAddresss("plugin.task-package.frontend.index.line-code-page"),
            data: {},
            success: function(e) {
                var a = e.data;
                1 == a.result && t.setData({
                    line_code_switch: a.data.line_code_switch,
                    parent_info: a.data.parent_info
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    onReady: function() {},
    onShow: function() {
        this.setData({
            value: "",
            show: !0
        }), this.getData();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});